<ul>
<?php
$edit_btn = BUtils::T('edit_btn');
$delete_btn = BUtils::T('delete_btn');
$submit_btn = BUtils::T('submit_btn');

$class = null;
$index = 0;
foreach ($model as $k => $row) {
	if (empty($row['cateogry_name'])) $row['cateogry_name'] = 'general';
	if ($row['cateogry_name'] != $class) {
		$class = empty($row['cateogry_name']) ? $class : $row['cateogry_name'];
		$index = 0;
		echo '<div class="clear"></div></ul><ul class="menuItems"><div class="menuCategory">'.$class.'</div>';
	} else {
		$index ++;
	}
	$price = Yii::app()->locale->numberFormatter->formatCurrency($row['price'], 'EUR');
	
	//name
	$name = (empty($row['number']) ? '' : $row['number'] . '. ') . $row['name'];
	
	if ($index % 4 == 0 or $index % 4 == 1) $oddRow = 'oddRow';
	else $oddRow = '';
?>
<li id="item_<?php echo $row['id']; ?>" class="<?php echo $oddRow ?>">
	<a href="<?php echo Yii::app()->createUrl('menu/preview', array('id'=>$row['id'])); ?>" class="preview-btn-menu">
		<span class="item_name"><?php echo $name; ?></span>
		<span class="item_price"><?php echo $price; ?></span>
		<div class="clear"></div>
	</a>
</li>
<?php
}
?>
<div class="clear"></div>
</ul>
<div class="clear"></div>
<script type="text/javascript">
$(function() {
	$('.preview-btn-menu').fancybox({
		transitionIn	:	'none',
		transitionOut	:	'none',
		changeSpeed : 0,
		overlayShow	:	true
	});
});
</script>